#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int maxn = 100+6;
int arr[maxn];
int solve() {
  int n,x;cin>>n>>x;
  for(int i=0;i<n;++i) {
    cin>>arr[i];
  }
  ll sum=0; // Variable UNINITIALIZED
  int cnt=0;
  int *beg = arr, *ed=arr;
  while(ed != arr+maxn) {
    while(sum < x) {
      sum += *ed++;
    }
    if(sum == x) {
      cnt++;
      sum+=*ed++;
      sum-=*beg++;
    }
    else {  // sum > x
      sum -= *beg++;
    }
  }
  while(beg!=ed && sum>x) {
    sum -= *beg++;
    if(sum==x) cnt++;
  }

  cout << cnt << endl;
  return 0;
}

int main() {
  freopen("in.txt", "r", stdin);
  solve();
  return 0;
}
